<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<script type="text/javascript">
	var lastsel = 0;
</script>
<form:form commandName="model" cssClass="validate"
	action="db/entity/saveMonitorMap">
	<input type="hidden" name="tableName" value=${tableName } >
	<div class="header">
		<h2>设定slm监控字段</h2>
	</div>
	<table class="form-table">

		<tr>
			<td class="td1">选择slm监控字段：</td>
			<td class="td2"><isperp:listSelector
					id="slmMonitorColumnSelector" name="slmMonitorColumn" 
					displayValue="${model.slmMonitorColumn }" inputReadonly="false"
					displayColumn="columnName" valueColumn="columnName" dialogWidth="420"
					showPager="false" url="db/entityField/list?entityId=${model.id }">
					<isperp:column name="name" title="名称" width="100">
					</isperp:column>
					<isperp:column name="fieldType" title="字段类型" width="100">
					</isperp:column>
					<isperp:column name="columnName" title="数据库列名" width="120">
					</isperp:column>
				</isperp:listSelector>
			</td>
		</tr>
		
		<tr>
			<td class="td1">选择slm_id字段关联实体表：</td>
			<td class="td2">
			<isperp:listSelector id="slmRelyTableNameSelector" name="slmRelyTableName" dialogWidth="300"
						valueControlId="slmRelyTableName" displayValueCssClass="required"
						url="db/entity/showTables" valueColumn="Tables_in_isperp_db"
						displayValue="${model.slmRelyTableName }"
						displayColumn="Tables_in_isperp_db" showPager="false">
						<isperp:column name="Tables_in_isperp_db" title="表名称"></isperp:column>
						
					</isperp:listSelector>
			 
			</td>
		</tr>

	</table>
	<div class="header">
		<h2>设定字段映射关系</h2>
	</div>
	<input type="hidden" name="mapsSize" value="${mapsSize }">
	<table class="form-table">

		<tr>
			<td class="td1" >slm监控字段值</td>
			<td class="td2" >映射数据字段名称</td>
		</tr>
		<c:forEach items="${maps }" var="map" varStatus="vs">
			<tr>
				<td class="td1">${map.status }</td>
				<td class="td2"><input type="hidden" name="status${vs.index }"
					value="${map.status }"> <input type="text"
					name="columnName${vs.index }" value="${map.column_name }">
				</td>
			</tr>
		</c:forEach>
	</table>

</form:form>

<isperp:buttonList>
	<button class="submit" onclick="isperp.submitForm();return false;">
		<span class="icon icon-save"></span>提交
	</button>
</isperp:buttonList>